x86/hvm: improve "Emulation failed @" error messages
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 1 Oct 2014 09:36:10 +0000 (11:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 1 Oct 2014 09:36:10 +0000 (11:36 +0200)
commit96720ccf3ad1b6cbe7c11069a3bc730bd0fe7fa3
tree626ff2f1ef6f33806524911bd7285776bcc72ba8
parent01c62426eee721c6faf63bba95d69453e0ce1822
x86/hvm: improve "Emulation failed @" error messages

* Introduce hvm_dump_emulation_state() to be a common implementation rather
  than having the printk() open-coded slightly differently in 3 separate
  places.
* Identify the vcpu operating mode to allow for unambiguous decoding of the
  instruction bytes.
* A valid instruction can be up to 15 bytes long, but may also be shorter than
  the current arbitrary 10 bytes.  Print only the fetched bytes, which could
  include nothing if the emulation failed due to an inability to fetch the
  instruction.

A sample new error message looks like:

(d1) MMIO emulation failed: d1v0 64bit @ 0008:ffff82d0802c4f20 -> 48 8b b8 e8 7f 00 00

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Release-acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/emulate.c
xen/arch/x86/hvm/io.c
xen/arch/x86/hvm/vmx/realmode.c
xen/include/asm-x86/hvm/emulate.h